
var sort1 = function(tokens){


  const result = new Array(tokens.length).fill(0)

  console.log(result)
  
  for(var i=0;i<tokens.length;i++){

   for(var j=i+1;j<tokens.length;j++){
    if(tokens[i]<tokens[j]){
      result[i]= j
      break;
    }
   }

  }

  console.log(result)

}

var arrays = [123,124,125,121,119,122,126,123];

sort1(arrays)


